package cn.maihe.elg.operation.service.facade;

import cn.maihe.elg.operation.institution.InstitutionServiceInterface;
import cn.maihe.elg.operation.model.dto.BaseResp;
import cn.maihe.elg.operation.model.dto.InnerBaseResp;
import cn.maihe.elg.operation.model.dto.institution.ApplyOrderReqDTO;
import cn.maihe.elg.operation.model.dto.institution.NotifyOrderReqDTO;
import cn.maihe.elg.operation.model.enums.InstitutionCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description 订单-出函机构交互
 * @Author WJH
 * @Date 2021/05/11
 */
@Service
@Slf4j
public class OrderInstitutionFacadeService {

    @Resource
    private InstitutionServiceInterface institutionServiceInterface;


    /**
     * 向出函机构申请开立保函
     *
     * @param req
     * @return
     */
    public InnerBaseResp<BaseResp> applyGuarantee(InstitutionCode institutionCode, ApplyOrderReqDTO req) {
        return institutionServiceInterface.applyGuarantee(req, null);
    }

    /**
     * 出函机构受理申请保函状态通知
     *
     * @param req
     * @return
     */
    public InnerBaseResp<BaseResp> notifyOrderStatus(InstitutionCode institutionCode, NotifyOrderReqDTO req) {
        return institutionServiceInterface.notifyOrderStatus(req, null);
    }


}
